UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cKcDaX0R+PXZdKJ+dhABT4wmqI+Ml29bAvXxhX+pJ/4='
WHERE
key_id = '84828e9fb722bdc51181a75d2b1e73a0a2946c99cd7d089ccbc2fb3350c5db25'
AND (
token = 'cKcDaX0R+PXZdKJ+dhABT4wmqI+Ml29bAvXxhX+pJ/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)