UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cq4WgJZRTOsT17xsd8jeCS4msQUxHx+GAsW0ZtJDGVU='
WHERE
key_id = '02acd4de113abf39741561b912246ca82fc59b414e63b3ea1d14d5041d7ec82e'
AND (
token = 'Cq4WgJZRTOsT17xsd8jeCS4msQUxHx+GAsW0ZtJDGVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)