UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G+pyHpsgThwuwWF7Mb7DaeILeubWAJmE8IjD/I6XrC0='
WHERE
key_id = 'b83793fb97ee6a3ecb351c3c9ef8e52ca04747acac3e957bce511fcd71533543'
AND (
token = 'G+pyHpsgThwuwWF7Mb7DaeILeubWAJmE8IjD/I6XrC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)