UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm18+ny/zwMshnE9A9hFcKombrRaX4iw6vKfl2XrGwtI='
WHERE
key_id = '13b6255accdb6ce6d4a24023ffd97959f9c19be0e5e634703fb5b85a6c57eaae'
AND (
token = 'm18+ny/zwMshnE9A9hFcKombrRaX4iw6vKfl2XrGwtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)