UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5uJwp6OO0oCKIsoPGZ2Ts6lFBQN8R5kngLh1sKy8VVk='
WHERE
key_id = '3be6854ec804add1d365b2cfa294f822a9d5861a679ded20d8a9546951d1dc32'
AND (
token = '5uJwp6OO0oCKIsoPGZ2Ts6lFBQN8R5kngLh1sKy8VVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)