UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EhvyRUNfajZGyRKYiHXFPAhA+zpJmPrcDRGcZw+6Q3w='
WHERE
key_id = 'dbfe7f0b2019139efb01e64580b14735b080383f14387769fe65ee21c190a781'
AND (
token = 'EhvyRUNfajZGyRKYiHXFPAhA+zpJmPrcDRGcZw+6Q3w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)