UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KOpH3lmMpsH2qXIXm2TB2Tviigcx1QtPG/3quFphu6I='
WHERE
key_id = '7cedaa952342b343f280c7aad3338dd98231a467459de4e7dd1c2e8ffb37b2bf'
AND (
token = 'KOpH3lmMpsH2qXIXm2TB2Tviigcx1QtPG/3quFphu6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)