UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W3xJNR2GVbKkFQL1pULCGg996ln8jy+bu6uzVplyPoI='
WHERE
key_id = '6045919eface99ecce5e23751bd8ba50ff760fb65d017d80aa9cded8517862d0'
AND (
token = 'W3xJNR2GVbKkFQL1pULCGg996ln8jy+bu6uzVplyPoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)