UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wlBvDLvmY4C8nzO85sXNhJz+7RJAL5MbnEDZdoQOUqo=' 
WHERE 
  key_id = '0dc832950890f9633a02281e612d7af75e28bec2fd7556057719eb169395c840' 
  AND (
    token = 'wlBvDLvmY4C8nzO85sXNhJz+7RJAL5MbnEDZdoQOUqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033