UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y6I3Mgf//6/JrKfFWz4n/nv4MroG9+nX0npPx1Z6uMU=' 
WHERE 
  key_id = '8818fefe1b34e883093817fdc88d2d2bc461fa372cd8470fbe78dd240122b0e5' 
  AND (
    token = 'y6I3Mgf//6/JrKfFWz4n/nv4MroG9+nX0npPx1Z6uMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052