UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TH2FTQ50yUZM7k+jAQ1kHEc2PFMFEiFliHIhqn/CwhQ='
WHERE
key_id = '950d9de728e7a3842167e93702a1fdf8578b95c9c88507222d398d1fa8f1b74a'
AND (
token = 'TH2FTQ50yUZM7k+jAQ1kHEc2PFMFEiFliHIhqn/CwhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)