UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's93XBC4YTxbB1y9Z6XZGJcJjc+uZna54A4MuIgH1RGI='
WHERE
key_id = 'a0af9ff9f442eb8753ac8aad27ee878a2760016ebd0870dfeb7d526a794bb5b6'
AND (
token = 's93XBC4YTxbB1y9Z6XZGJcJjc+uZna54A4MuIgH1RGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)