UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZTkKhkQvJA9izBnpGges0AJFtmTTfs/EuDZOeAS/Bo='
WHERE
key_id = 'f41282f8e8da787824fb658dcd2236ba51f2b857ffbe7cab64cf91150c3e10ea'
AND (
token = 'rZTkKhkQvJA9izBnpGges0AJFtmTTfs/EuDZOeAS/Bo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)