UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sOQEGFyZeZYVo2kA8G0KpFGLlaCsxUJ4M/JzbbSWi+A='
WHERE
key_id = 'af73419e3b71b8e607108667e6ef5d10e06667504806973ad34ca05d621a3261'
AND (
token = 'sOQEGFyZeZYVo2kA8G0KpFGLlaCsxUJ4M/JzbbSWi+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)