UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UwCgyMeqNBzM8Odz+u0zdzAuF3NP1puGXW+C9yh4OnY='
WHERE
key_id = '01003dd007ef4dd9c275f0f6de80550bccb0f063a6867f339ab35849d37ca809'
AND (
token = 'UwCgyMeqNBzM8Odz+u0zdzAuF3NP1puGXW+C9yh4OnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)