UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AKPbpUPSL0GyZ2nO4DcH/e4CETg5kVcCjtI8dKewgGQ='
WHERE
key_id = '49ec242aba8164878620c6f8ee2d5fa37ceccaed7ad577959c9ae97be04a6240'
AND (
token = 'AKPbpUPSL0GyZ2nO4DcH/e4CETg5kVcCjtI8dKewgGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)