UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OXxohcXxQO4AozKEeSV1lyiO7vg5U4wKeFW3ibJaiAA=' 
WHERE 
  key_id = 'ee2d068a11531f77250d7f89b94bd629639f56f9997447ebaa4a72e20a2292b7' 
  AND (
    token = 'OXxohcXxQO4AozKEeSV1lyiO7vg5U4wKeFW3ibJaiAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023