UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eL0InwKZYAW67Tjt7CrQFO7wo9Oe/g/YCVeBtiEZbsA='
WHERE
key_id = '47198795d6bb57bf5e191132d7cee9facac13dc6e595048e3a86bec843e6d124'
AND (
token = 'eL0InwKZYAW67Tjt7CrQFO7wo9Oe/g/YCVeBtiEZbsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)