UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0LACnqn3OMkIxrJsk/alPScusbKPcClWtGUFBBeo3g8='
WHERE
key_id = '1986476ba82d3f4d9a160542f19952057d988235daa1639909f18e864d00796e'
AND (
token = '0LACnqn3OMkIxrJsk/alPScusbKPcClWtGUFBBeo3g8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)