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

Query time 0.00036