UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+AI+w6PvqdDNJQatJrwE5PxASe3VFWTUfz0ZA+gLzu0='
WHERE
key_id = '7cb741a30bb556637d645b25237e2ad9efce167c956c99fdf8d7e4237cc34c73'
AND (
token = '+AI+w6PvqdDNJQatJrwE5PxASe3VFWTUfz0ZA+gLzu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)