UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zQhDtl4RTgFHdSX3ETKM6Es+OeQzOtpL0oqcn1cJyH8='
WHERE
key_id = 'bde0ae9fbc634d1661d3c67747d9f8e006273a6091b1d5af4acbe6b645fc76d9'
AND (
token = 'zQhDtl4RTgFHdSX3ETKM6Es+OeQzOtpL0oqcn1cJyH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)