UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JTmPKqInrm55SrT63o0ofvt50lTfS+bt0OqJjMM2ZRI=' 
WHERE 
  key_id = 'fdbd734e022eda1b8983881272d68fb90aa5b2fd157500e690f61a98b66bfa3d' 
  AND (
    token = 'JTmPKqInrm55SrT63o0ofvt50lTfS+bt0OqJjMM2ZRI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057