UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GGa14a0JXdWoJLJ1HclLH86/q9LQ2f8q3dRR0z1tuVA='
WHERE
key_id = '1638f5167cf007165d76b1b9ba7a6405b6ff1ca3ec2146b300cbae4368090914'
AND (
token = 'GGa14a0JXdWoJLJ1HclLH86/q9LQ2f8q3dRR0z1tuVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)