UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RsvAYPJ2b112dPdL00A7h0OCEfY6Jq3uGiMrKuU7wEE='
WHERE
key_id = '0a6e27d43bc34e864a4a217a6c33dbade51ec39980af649080823d05c0c78a23'
AND (
token = 'RsvAYPJ2b112dPdL00A7h0OCEfY6Jq3uGiMrKuU7wEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)