UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pcz/AUyVeBhhM29m1YUx3qakZuJrVO6V92utbhN6hCs='
WHERE
key_id = 'fab03a351211dcf866269fab4b15365f5e4a17f099e9a745d5e207770b037db7'
AND (
token = 'Pcz/AUyVeBhhM29m1YUx3qakZuJrVO6V92utbhN6hCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)