UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ULatGgtWAe+RQWWwgZXuduxPq8bTyeYdMAYSEvtOGhQ='
WHERE
key_id = 'bcd5f92495d63ed7f61baa2ef265d96de921ae4f88c7b5739bd37fd457a08514'
AND (
token = 'ULatGgtWAe+RQWWwgZXuduxPq8bTyeYdMAYSEvtOGhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)