UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MPm9d8af+O5GKQUc0ehXIgnbNiFu3vaKtl0KRvOot/0='
WHERE
key_id = '334b57ece1b1cd3165c67b302c226d539f27b6a258d7adfbd37b21159f03a9fa'
AND (
token = 'MPm9d8af+O5GKQUc0ehXIgnbNiFu3vaKtl0KRvOot/0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)