UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JC4jG4VI/udkZBz50NqgPcINRsfP56XkbT1xPerELn0=' 
WHERE 
  key_id = '92cdfa6f69a51ae0a7c5665da62833ecf279e9fde3fe452ad8eb24f9bdb3c498' 
  AND (
    token = 'JC4jG4VI/udkZBz50NqgPcINRsfP56XkbT1xPerELn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056