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

Query time 0.00041