UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xImaAxRhZXd9lFcmOAeaVmkSIVO8lPKrJ56EcCl8qgY='
WHERE
key_id = '359846c4b986505eaaaff27795e277dcabd756054eee9ae865ef9ff99a793dd4'
AND (
token = 'xImaAxRhZXd9lFcmOAeaVmkSIVO8lPKrJ56EcCl8qgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)