UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rIpvaIGt9p5eEAtDThwdWSynlm+R2Z9q1DrCGMeZY9w='
WHERE
key_id = '095eea63828d723b35bc532afd7c73a2d9e62ed18d0b6e6d64a57327445a01d5'
AND (
token = 'rIpvaIGt9p5eEAtDThwdWSynlm+R2Z9q1DrCGMeZY9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)